<template>
  <Form ref="searchForm" :model="form" label-position="right" :label-width="100">
    <Row type="flex">
      <Col>
      <FormItem label="关键字" prop="search">
        <Input v-model="form.search" placeholder="用户名/姓名/手机号">
          <Button slot="append" shape="circle" type="primary" icon="md-search" @click="onSearch">{{$t('search')}}</Button>
        </Input>
      </FormItem>
      </Col>
    </Row>
  </Form>
</template>
<script>
export default {
  props: {
    params: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  data () {
    return {
      form: {
        search: ''
      },
      rule: {
        search: [
          { required: false, message: '关键字不能为空', trigger: 'blur' }
        ]
      }
    }
  },
  mounted () {
    // this.form = this.model
  },
  methods: {
    onSearch () {
      this.$emit('on-search', this.form)
    },
    onReset () {
      this.$refs['searchForm'].resetFields()
    }
  }
}
</script>
